#include "laser.h"
#include "action.h"
#include "utils.h"
#include "coord.h"

#ifdef __cplusplus
extern "C" {
#endif

/*********************| marcos |*********************/
CS_BUF_DECLAR(LASER_BULLET_BUF_SIZE, laserbu_t)
CS_BUF_DECLAR(LASER_BUF_SIZE, laser_t)

/*********************| static data |*********************/
typedef struct {
	bulletdata_t	b;
	// TODO:激光子弹的特性这里添加
	bool		ray;	//使用射线激光吗
	list_t*		aclist;
} laserbudata_t;

typedef struct {
	csobjdata_t	objtag;	// 元素标签
	list_t*		aclist;	// 事件
	laserbudata_t	bullet;	// 子弹
}laserdata_t;

/*********************| extern functions |*********************/

CSB_DLL csobjdata_t* laserdata_read(unsigned char* data, const uint32_t totalframe)
{
	return NULL;
}

CSB_DLL laser_t* laserdata_make_obj(const csobjdata_t* pdata)
{
	return NULL;
}

CSB_DLL void laserdata_free(csobjdata_t* plaser)
{

}

CSB_DLL void laser_buf_init()
{
	CS_BUF_INIT(laserbu_t);
	CS_BUF_INIT(laser_t);
}

CSB_DLL void laser_buf_end(bool force)
{
	CS_BUF_END(laser_t, force);
	CS_BUF_END(laserbu_t, force);
}

CSB_DLL laser_t* laser_buf_rent()
{
	CS_BUF_RENT(laser_t, ret);
	return ret;
}

CSB_DLL void laser_buf_return(laser_t* pla) { CS_BUF_RETURN(laser_t, pla); }

CSB_DLL void laser_emit(csnode_t* pcsn)
{

}

CSB_DLL void laser_update(csnode_t* pcsn, bool updateObj, bool updateBullet)
{

}

CSB_DLL void laserbu_buf_return(laserbu_t* pbu) { CS_BUF_RETURN(laserbu_t, pbu);}

#ifdef __cplusplus
} /* end extern C */
#endif
